package com.rd.student.jike.class2.lihongming.Solution713;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

/**
 * @Auther:Heinrich
 * @Date:2023/7/14-07-14-15:30
 * @Description:com.rd.student.jike.class2.lihongming.Solution713
 * @version:1.0
 */
public class Question5 {
    public static boolean checkQQID(String QQiD){
        if(QQiD.length()>9||QQiD.length()<6){
            return false;
        }
        //检查非数字1
//        for (int i = 0; i < QQiD.length(); i++) {
//            if(QQiD.charAt(i)=='0'||QQiD.charAt(i)=='1'||QQiD.charAt(i)=='2'||QQiD.charAt(i)=='3'||QQiD.charAt(i)=='4'||QQiD.charAt(i)=='5'||QQiD.charAt(i)=='6'||QQiD.charAt(i)=='7'||QQiD.charAt(i)=='8'||QQiD.charAt(i)=='9'){
//                return true;
//            }
//        }
//        return false;
        //检查非数字2
//        int count = 0;
//        String NUM = "0123456789";
//        for (int i = 0; i < QQiD.length(); i++) {
//            for (int j = 0; j < NUM.length(); j++) {
//                if(QQiD.charAt(i)==NUM.charAt(j)){
//                    count++;
//                    break;
//                }
//            }
//        }
//        if(count!=QQiD.length()){
//            return false;
//        }
        return true;
    }
    public static HashSet screenQQID(String[] QQidStr){
        HashSet QQidSet = new HashSet();
        for (int i = 0; i < QQidStr.length; i++) {
            if(Question5.checkQQID(QQidStr[i])){
                QQidSet.add(QQidStr[i]);
            }
        }
        return QQidSet;
    }

    public static void main(String[] args) {
        String[] QQid = {"12345","67891","123478099","9876543","67891",
                "12347809933","12809933","12347809933111","9876543","12809933"};
        System.out.println(Question5.screenQQID(QQid));
    }


}
